import request from '@/utils/request'

// 查询租户钱包列表
export function listTenantWallet(query) {
  return request({
    url: '/customer/v1/tenant/wallet/page',
    method: 'post',
    data: query
  })
}

// 查询租户钱包详细
export function getTenantWallet(id) {
  return request({
    url: '/customer/v1/tenant/wallet?id=' + id,
    method: 'get'
  })
}

// 新增租户钱包
export function addTenantWallet(data) {
  return request({
    url: '/customer/v1/tenant/wallet?google_code=' + data.google_code,
    method: 'post',
    data: data
  })
}

// 修改租户钱包
export function updateTenantWallet(data) {
  return request({
    url: '/customer/v1/tenant/wallet?google_code=' + data.google_code,
    method: 'put',
    data: data
  })
}

// 刷新租户钱包余额
export function refreshBalance(id) {
  return request({
    url: '/customer/v1/tenant/wallet/refresh_balance?id=' + id,
    method: 'post'
  })
}

// 租户支付钱包转账
export function transfer(data) {
  return request({
    url: '/customer/v1/tenant/wallet/transfer?google_code=' + data.google_code,
    method: 'post',
    data: data
  })
}

// 查询租户支付钱包列表
export function getPayList(appId, network) {
  return request({
    url: '/customer/v1/tenant/wallet/pay_list?app_id=' + appId + '&network=' + network,
    method: 'get'
  })
}

// 查询租户激活钱包列表
export function getActiveList(appId, network) {
  return request({
    url: '/customer/v1/tenant/wallet/active_list?app_id=' + appId + '&network=' + network,
    method: 'get'
  })
}

// 查询租户收款钱包列表
export function getIncomeList(appId, network) {
  return request({
    url: '/customer/v1/tenant/wallet/income_list?app_id=' + appId + '&network=' + network,
    method: 'get'
  })
}


// 查询租户委托钱包列表
export function getDelegateList(appId) {
  return request({
    url: '/customer/v1/tenant/wallet/delegate_list?app_id=' + appId,
    method: 'get'
  })
}
